Skip to content

Comments

Implement FromStr for BitMove and SQ#170

Merged
chase-manning merged 4 commits intomainfrom
copilot/add-bitmove-deserialization
Feb 22, 2026
Merged

Implement FromStr for BitMove and SQ#170
chase-manning merged 4 commits intomainfrom
copilot/add-bitmove-deserialization

Conversation

Copy link
Contributor

Copilot AI commented Feb 22, 2026

  • Understand codebase: BitMove::stringify() outputs UCI format like "e2e4" or "a7a8q", but there's no way to parse a BitMove back from a string
  • Implement FromStr for SQ in pleco/src/core/sq.rs - parse "a1" through "h8" into SQ values
  • Implement FromStr for BitMove in pleco/src/core/piece_move.rs - parse UCI move strings like "e2e4" and "a7a8q"
  • Add tests for the new FromStr implementations (6 new tests, all passing)
  • Run existing tests to ensure no regressions (all 13 tests pass)
  • Code review and security checks (no issues found)
  • Fix cargo fmt lint failure
Original prompt

This section details on the original issue you should resolve

<issue_title>BitMove from string</issue_title>
<issue_description>Noticed there is no real way to de serialize a bitmove without using the raw data. Would be nice if we could use the stringified version</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits February 22, 2026 12:31
…strings

Co-authored-by: chase-manning <53957795+chase-manning@users.noreply.github.com>
Co-authored-by: chase-manning <53957795+chase-manning@users.noreply.github.com>
Copilot AI changed the title [WIP] Add deserialization for bitmove from string Implement FromStr for BitMove and SQ Feb 22, 2026
Copilot AI requested a review from chase-manning February 22, 2026 12:34
@chase-manning
Copy link
Contributor

@copilot linting ci broken

Co-authored-by: chase-manning <53957795+chase-manning@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 22, 2026

@copilot linting ci broken

Fixed in 7094b87 — the write! macro calls in the Display impls for SQFromStrError and BitMoveFromStrError needed line-wrapping to satisfy cargo fmt.

@chase-manning chase-manning marked this pull request as ready for review February 22, 2026 23:35
@chase-manning chase-manning merged commit b1dd810 into main Feb 22, 2026
4 checks passed
@chase-manning chase-manning deleted the copilot/add-bitmove-deserialization branch February 22, 2026 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BitMove from string

2 participants